<!--
 * @Author: ChengNan 1429323234@qq.com
 * @Date: 2024-08-05 15:36:02
 * @LastEditors: ChengNan 1429323234@qq.com
 * @LastEditTime: 2024-08-05 19:34:09
 * @FilePath: /src/views/10.vritualSelect/ItemComp.vue
 * @Description: 
-->
<template>
  <Option :value="source.id" :key="source.id"
  :class="{
    'ivu-select-item': true,
    'ivu-select-item-selected': d_selectId === source.id
  }"
  >{{ source.name }}</Option>
</template>

<script>
import isa from './isa';
export default {
  props: {
    selectId: {
      type: Number | String,
      default: () => ''
    },
    index: {
      type: Number,
      default: 0
    },
    source: {
      type: Object,
      default: () => {}
    },
  },
  data() {
    return {
      d_selectId: '',
    }
  },
  watch: {
    selectId: {
      immediate: true,
      deep: true,
      handler() {
        this.d_selectId = isa.get(isa.getData()._key)
      }
    }
  },
}
</script>

<style lang="scss" scoped>

</style>